package com.quick.base;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class BaseEntity {
	@ApiModelProperty(value = "ID", example = "主键ID")
	@TableId(type = IdType.AUTO)
    private Integer id;
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间", example = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "创建人", example = "用户ID")
    private Integer createBy;
    @ApiModelProperty(value = "创建姓名", example = "用户姓名")
    private String createName;
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "最近更新时间", example = "用户ID")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "最近更新人ID", example = "yyyy-MM-dd HH:mm:ss")
    private Integer updateBy;
    @ApiModelProperty(value = "最近更新人姓名", example = "用户姓名")
    private String updateName;
    @ApiModelProperty(value = "是否删除", example = "0正常1删除")
    private String isDelete;
}
